home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / include / xpcom / nsISerializable.h < prev    next >
C/C++ Source or Header  |  2006-05-08  |  4KB  |  121 lines

  1. /*
  2.  * DO NOT EDIT.  THIS FILE IS GENERATED FROM nsISerializable.idl
  3.  */
  4.  
  5. #ifndef __gen_nsISerializable_h__
  6. #define __gen_nsISerializable_h__
  7.  
  8.  
  9. #ifndef __gen_nsISupports_h__
  10. #include "nsISupports.h"
  11. #endif
  12.  
  13. /* For IDL files that don't want to include root IDL files. */
  14. #ifndef NS_NO_VTABLE
  15. #define NS_NO_VTABLE
  16. #endif
  17. class nsIObjectInputStream; /* forward declaration */
  18.  
  19. class nsIObjectOutputStream; /* forward declaration */
  20.  
  21.  
  22. /* starting interface:    nsISerializable */
  23. #define NS_ISERIALIZABLE_IID_STR "91cca981-c26d-44a8-bebe-d9ed4891503a"
  24.  
  25. #define NS_ISERIALIZABLE_IID \
  26.   {0x91cca981, 0xc26d, 0x44a8, \
  27.     { 0xbe, 0xbe, 0xd9, 0xed, 0x48, 0x91, 0x50, 0x3a }}
  28.  
  29. class NS_NO_VTABLE nsISerializable : public nsISupports {
  30.  public: 
  31.  
  32.   NS_DEFINE_STATIC_IID_ACCESSOR(NS_ISERIALIZABLE_IID)
  33.  
  34.   /**
  35.      * Initialize the object implementing nsISerializable, which must have
  36.      * been freshly constructed via CreateInstance.  All data members that
  37.      * can't be set to default values must have been serialized by write,
  38.      * and should be read from aInputStream in the same order by this method.
  39.      */
  40.   /* void read (in nsIObjectInputStream aInputStream); */
  41.   NS_IMETHOD Read(nsIObjectInputStream *aInputStream) = 0;
  42.  
  43.   /**
  44.      * Serialize the object implementing nsISerializable to aOutputStream, by
  45.      * writing each data member that must be recovered later to reconstitute
  46.      * a working replica of this object, in a canonical member and byte order,
  47.      * to aOutputStream.
  48.      *
  49.      * NB: a class that implements nsISerializable *must* also implement
  50.      * nsIClassInfo, in particular nsIClassInfo::GetClassID.
  51.      */
  52.   /* void write (in nsIObjectOutputStream aOutputStream); */
  53.   NS_IMETHOD Write(nsIObjectOutputStream *aOutputStream) = 0;
  54.  
  55. };
  56.  
  57. /* Use this macro when declaring classes that implement this interface. */
  58. #define NS_DECL_NSISERIALIZABLE \
  59.   NS_IMETHOD Read(nsIObjectInputStream *aInputStream); \
  60.   NS_IMETHOD Write(nsIObjectOutputStream *aOutputStream); 
  61.  
  62. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  63. #define NS_FORWARD_NSISERIALIZABLE(_to) \
  64.   NS_IMETHOD Read(nsIObjectInputStream *aInputStream) { return _to Read(aInputStream); } \
  65.   NS_IMETHOD Write(nsIObjectOutputStream *aOutputStream) { return _to Write(aOutputStream); } 
  66.  
  67. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  68. #define NS_FORWARD_SAFE_NSISERIALIZABLE(_to) \
  69.   NS_IMETHOD Read(nsIObjectInputStream *aInputStream) { return !_to ? NS_ERROR_NULL_POINTER : _to->Read(aInputStream); } \
  70.   NS_IMETHOD Write(nsIObjectOutputStream *aOutputStream) { return !_to ? NS_ERROR_NULL_POINTER : _to->Write(aOutputStream); } 
  71.  
  72. #if 0
  73. /* Use the code below as a template for the implementation class for this interface. */
  74.  
  75. /* Header file */
  76. class nsSerializable : public nsISerializable
  77. {
  78. public:
  79.   NS_DECL_ISUPPORTS
  80.   NS_DECL_NSISERIALIZABLE
  81.  
  82.   nsSerializable();
  83.  
  84. private:
  85.   ~nsSerializable();
  86.  
  87. protected:
  88.   /* additional members */
  89. };
  90.  
  91. /* Implementation file */
  92. NS_IMPL_ISUPPORTS1(nsSerializable, nsISerializable)
  93.  
  94. nsSerializable::nsSerializable()
  95. {
  96.   /* member initializers and constructor code */
  97. }
  98.  
  99. nsSerializable::~nsSerializable()
  100. {
  101.   /* destructor code */
  102. }
  103.  
  104. /* void read (in nsIObjectInputStream aInputStream); */
  105. NS_IMETHODIMP nsSerializable::Read(nsIObjectInputStream *aInputStream)
  106. {
  107.     return NS_ERROR_NOT_IMPLEMENTED;
  108. }
  109.  
  110. /* void write (in nsIObjectOutputStream aOutputStream); */
  111. NS_IMETHODIMP nsSerializable::Write(nsIObjectOutputStream *aOutputStream)
  112. {
  113.     return NS_ERROR_NOT_IMPLEMENTED;
  114. }
  115.  
  116. /* End of implementation class template. */
  117. #endif
  118.  
  119.  
  120. #endif /* __gen_nsISerializable_h__ */
  121.